home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / Visual BASIC 5.0 (Ent. Edition) / Vb5ent Extractor.EXE / VB / SAMPLES / ENTRPRIS / APE / AEINSTNR / INSTNCER.CLS < prev    next >
Encoding:
Visual Basic class definition  |  1996-12-04  |  1.4 KB  |  34 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "Instancer"
  6. Attribute VB_GlobalNameSpace = False
  7. Attribute VB_Creatable = True
  8. Attribute VB_PredeclaredId = False
  9. Attribute VB_Exposed = True
  10. Attribute VB_Description = "Used to create a local instance of a server after a remote instance has been created."
  11. Option Explicit
  12. Public Function Object(ByVal sProgID As String) As Object
  13. Attribute Object.VB_Description = "Returns a new instance of a server whose ProgID matches the sProgID parameter."
  14.     '-------------------------------------------------------------------------
  15.     'Purpose:
  16.     '   This public class is a work around for error
  17.     '   -2147221166 (80040152) which occurrs every time a client
  18.     '   object creates an instance of a remote server,
  19.     '   destroys it, registers it local, and tries to
  20.     '   create a local instance.  The client can not
  21.     '   create an object registered locally after it created
  22.     '   an instance while it was registered remotely
  23.     '   until it shuts down and restart.  Therefore,
  24.     '   it works to call another process to create the
  25.     '   local instance and pass it back.
  26.     'In:
  27.     '   [sProgID]
  28.     '       ProgID of needed object
  29.     'Return:
  30.     '   Object created using the passed progId
  31.     '-------------------------------------------------------------------------
  32.     Set Object = CreateObject(sProgID)
  33. End Function
  34.